package com.sjc.counter.v3;

import com.sjc.counter.entity.RequestInfo;

import java.util.ArrayList;
import java.util.List;

/**
 * @Classname Demo
 * @Description
 * @Date 2020/5/1 23:28
 * @Created by SangJiacun
 */
public class Demo {
    public static void main(String[] args) {
        ConsoleReporter consoleReporter = new ConsoleReporter();
        consoleReporter.startRepeatedReport(60,60);

        List<String> emailToAddresses = new ArrayList<>();
        emailToAddresses.add("969681135@qq.com");
        EmailReporter emailReporter = new EmailReporter(emailToAddresses);
        emailReporter.startDailyReport();

        MetricsCollector metricsCollector = new MetricsCollector();
        metricsCollector.recordRequest(new RequestInfo("register", 123, 10234));
        metricsCollector.recordRequest(new RequestInfo("register", 223, 11234));
        metricsCollector.recordRequest(new RequestInfo("register", 323, 12334));
        metricsCollector.recordRequest(new RequestInfo("login", 23, 12434));
        metricsCollector.recordRequest(new RequestInfo("login", 1223, 14234));

        try {
            Thread.sleep(100000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }
}
